package com.Sumcc.conf.rabbitmq;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author Nick
 * @date 2019/9/1
 */
@Component
public class RabbitMQListener {

    /**
     * 自动声明队列 写好绑定关系
     * @param message
     */
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = "chat.message.queue",durable = "true"),
            exchange = @Exchange(value = "chat.message.exchange",type = ExchangeTypes.TOPIC),
            key = {"#.#"}
    ))
    public void getChatMessage(String message){

    }
}
